﻿using HlELock.Core;
using HlELock.Domain;
using HlELock.Modules.Hotel.Main;
using HlELock.Page;
using HlELock.Page.Views;
using Microsoft.EntityFrameworkCore;
using Prism.Ioc;
using Prism.Modularity;
using Syncfusion.Licensing;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Windows;

namespace HlElock.Agency
{
    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App
    {
        public App()
        {
            SyncfusionLicenseProvider.RegisterLicense("MzI0NzEzNkAzMjM1MmUzMDJlMzBESjFZZUlkbzBPZnhORzFERkZSbm9WaENMQVhYN1JXaUowY0tkOTBZNFpJPQ==");
            PageSetting.IsHotel = false;
            MyAppContext.Init();
        }
        protected override Window CreateShell()
        {
            using (var context = new HlELockDbContext())
            {
                context.Database.Migrate();
            }

            return Container.Resolve<MainWindow>();
        }


        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterForNavigation<TestPage>();
            containerRegistry.RegisterForNavigation<LoginPage>();
            containerRegistry.RegisterForNavigation<SearchDeviceControl>();
            containerRegistry.RegisterForNavigation<SearchHotelDeviceControl>();
        }
        protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog)
        {
            moduleCatalog.AddModule<HotelAgencyModule>();
            moduleCatalog.AddModule<CoreModule>();
        }

    }
}
